<?php

use app\models\Agent;
use app\models\Api;
use app\models\Isp;
use app\models\User;
use app\models\Package;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\widgets\Pjax;
use app\models\KeyMap;
use app\models\CardMultiOrder;
/**
 * @var $this yii\web\View
 * @var $model app\models\CardDispatchForm
 */

$this->title = '修改卡类型';
$this->params['breadcrumbs'][] = '物联网卡管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $form = ActiveForm::begin();?>

<fieldset>
    <?php echo $form->field($model, 'isp_id')->dropDownList(ArrayHelper::map($res = (new \yii\db\Query())
        ->select(['isp.name as name','isp.id as id'])
        ->from('agent_package')
        ->join('join','isp','isp.id=agent_package.isp')
        ->andWhere(['agent_package.agent_id'=> $agent])
        ->groupBy('agent_package.isp')
        ->all(), 'id', 'name'), ['prompt' => '选择运营商']);?>
</fieldset>
<fieldset>
<?php echo $form->field($model, 'iccid_list')->textarea(['style' => 'min-height:200px;']);?>
</fieldset>
<div class="form-group">
    <div class="col-lg-offset-1 col-lg-11">
        <button type="button" class="btn btn-default" onclick="window.history.go(-1);"><i class="ace-icon fa fa-arrow-left bigger-110"></i>返回</button>
        <button class="btn btn-primary"><i class="ace-icon fa fa-check bigger-110"></i>保存</button>
        <button type="reset" class="btn btn-warning"><i class="ace-icon fa fa-undo bigger-110"></i>重置</button>
    </div>
</div>
<?php $form->end();?>

